package kgc.qy.controller;

import kgc.qy.pojo.Registry;
import kgc.qy.service.IRegistryService;
import kgc.qy.util.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping(value = "reg")
@CrossOrigin
public class RegistryController {
    @Autowired
    private IRegistryService iRegistryService;

    @GetMapping(value = "getReg")
    public CommonResult getByIdOrStatus(@RequestParam(value = "id",required = false,defaultValue = "") Long id){
        List<Registry> byIdOrStatus = iRegistryService.getByIdOrStatus(id);
        return new CommonResult(200,"成功",byIdOrStatus);
    }
}
